﻿using BasicInformation.Domain;
using BasicInformation.Infrastructure.Interface;
using BasicInformation.ReadAPI.Application.Command.LineCommand;
using MediatR;

namespace BasicInformation.ReadAPI.Application.CommandHandler.LineCommandHandler
{
    public class LineInfoCommandHandler : IRequestHandler<LineInfoCommand, Line>
    {
        private readonly ILineRepository lineRepository;

        public LineInfoCommandHandler(ILineRepository lineRepository)
        {
            this.lineRepository = lineRepository;
        }

        public Task<Line> Handle(LineInfoCommand request, CancellationToken cancellationToken)
        {
            var info = lineRepository.Get(request.Id);
            return info;
        }
    }
}
